import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class code1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int n = in.nextInt();
            int ret = in.nextInt();
            int x = 0;
            for (int i = 0; i < n; i++) {
                x = in.nextInt();
                if (ret >= x) ret += x;
                else ret += gcd((long)x, ret);
            }
            System.out.println(ret);
        }
    }
    //求最大公约数：辗转相除递归版
    public static long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }


}